package logic.ships.frigate;

import java.util.ArrayList;
import java.util.List;

import logic.nodes.lod.blocks.LeafBlock;
import logic.ships.autoWeaponShip.BlockFinder;

public abstract class FrigateBlockFinder extends BlockFinder {
	
	private List<LeafBlock> oldLeafBlocks;
	
	public FrigateBlockFinder(Frigate frigate) {
		super(frigate);
	}
	
	@Override
	protected void updateBlocks() {
		oldLeafBlocks = new ArrayList<LeafBlock>(ship.getLeafBlocks());
		super.updateBlocks();
	}
	
	@Override
	protected boolean needsUpdate() {
		return super.needsUpdate() || !oldLeafBlocks.equals(ship.getLeafBlocks());
	}
}